#!/bin/bash
# WORKINGDIR=$(cd `dirname $0`; pwd)
# FILTERSTR=`echo $WORKINGDIR | awk -F '/' '{print $(NF-1)}'`
FILTERSTR="UK"
if [ $# -gt 1 ];then
    
      echo "第一种用法,不带参数,列举所有的 $FILTERSTR 进程"
      echo "第二种用法,带参数,列举所有的 $FILTERSTR 进程 中过滤指定名称后的进程"
      echo "第三种用法,没有哦!!!"
      exit 0
    
fi  

if [ $# -eq 1 ];then
      echo  -e "\e[1;31m ps -axj | grep -v grep | grep $FILTERSTR   | grep -w $1 \e[0m"

      ps -axj | head -n  1;ps -axj | grep -v grep |grep -v $0 | grep $FILTERSTR  | grep -w $1   --color=auto
      
else
      echo  -e "\e[1;31m ps -axj | grep -v grep | grep $FILTERSTR \e[0m"

      ps -axj | head -n  1;ps -axj | grep -v grep |grep -v $0 | grep $FILTERSTR  --color=auto
fi